Documentation for class matrix

Inherits from 	matrix_object 

Properties declared in matrix 
	does_allow_empty_selection 
	double_click_action 
	double_click_target 
	mode 

Class Methods declared in matrix 
	new 
	new_with(prototype, rows, columns) 

Methods declared in matrix 
	action 
		add_column 
		scroll_cell_to_visible(row, column) 
	any 
		add_column 
		cell_at(row, column) 
		column_at(column) 
		does_allow_empty_selection 
		double_click_action 
		double_click_target 
		do_double_click_action 
		insert_column_at(column) 
		mode 
		number_of_columns 
		remove_column_at(column) 
		replace_cell_at(cell, row, column) 
		row_at(row) 
		scroll_cell_to_visible(row, column) 
		selected_column 
		select_cell_at(row, column) 
		set_does_allow_empty_selection(boolean) 
		set_double_click_action(message_name) 
		set_double_click_target(object) 
		set_mode(symbol) 
	get 
		does_allow_empty_selection 
		double_click_action 
		double_click_target 
		mode 
	set 
		set_does_allow_empty_selection(boolean) 
		set_double_click_action(message_name) 
		set_double_click_target(object) 
		set_mode(symbol) 

Class 
#begin_class
matrix 
The class matrix is a sub-class of the class matrix_object. 
A matrix is a matrix object that may have more than one column.
The cells in a matrix may be text-field cells or button cells.
#end_class

Properties 

#begin_property
does_allow_empty_selection 
Stores a boolean value. If it is true the matrix will allow one or zero cells to be selected. If it is false the matrix will allow one and only one cell (not zero cells) to be selected. This setting has effect only if the mode of the matrix is #radio_mode. 
#end_property

#begin_property
double_click_action 
Stores the name of the action message that is used by the default implementation of the do_double_click_action method. The action message is sent to the object specified by the double_click_target property. 
#end_property

#begin_property
double_click_target 
Stores the reference to an object that receives the action message specified by the double_click_action property. When the object receives a do_double_click_action message it sends the action message to the target. 
#end_property

#begin_property
mode 
Stores a symbol that specifies the mode of the matrix.
The different modes are:
#track_mode - just track the mouse inside the cells
#highlight_mode - highlight the cell, then track, then unhighlight 
#radio_mode - Allow no more than one selected cell
#list_mode - Allow multiple selected cells
#end_property

Methods 

#begin_method
add_column 
Adds a new column of cells to the matrix.
Returns self.
#end_method

#begin_method
cell_at(row, column) 
Returns the cell at the position (row, column). If row or column are non-valid the method will return nil.
#end_method

#begin_method
column_at(column) 
Returns a collection of the cells in the column column. If column is not a valid column number the method will return nil.
#end_method

#begin_method
does_allow_empty_selection 
Returns the does_allow_empty_selection property of the matrix.
#end_method

#begin_method
double_click_action 
Returns the double_click_action property of the matrix.
#end_method

#begin_method
double_click_target 
Returns the double_click_target property of the matrix.
#end_method

#begin_method
do_double_click_action 
When the user double-clicks on the matrix the system sends a do_double_click_action message to the matrix. 
The default behavior of the do_double_click_action method in a matrix is to send the message stored in the double_click_action property to the object referenced by the double_click_target property.
Returns self.
Comment: Usually you just set the double_click_action and double_click_target properties to specify the behavior. 
You may override the default do_double_click_action behavior to get a specific behavior.
Note: If you want the double_click_action message to be sent to the double_click_target even when you override the do_double_click_action method, make sure the last line in your new do_double_click_action method is:
return super:do_double_click_action 
#end_method

#begin_method
insert_column_at(column) 
Inserts a new column of cells at column. If column is not a valid column number the method returns nil.
Returns self.
#end_method

#begin_method
mode 
Returns the mode property of the matrix.
#end_method

#begin_method
number_of_columns 
Returns the number of columns of the matrix.
#end_method

#begin_method
remove_column_at(column) 
Removes the column with the number column. If that column does not exist the method returns nil.
Returns self.
#end_method

#begin_method
replace_cell_at(cell, row, column) 
Replaces the cell at the position (row, col) with the cell cell. 
If row or column are non-valid the method will return nil. 
If cell is located in another gadget (i.e. the property gadget of the cell is not nil) the cell will not be inserted and the method will return nil.
#end_method

#begin_method
row_at(row) 
Returns a collection of the cells in the row row. If row is not a valid row number the method will return nil.
#end_method

#begin_method
scroll_cell_to_visible(row, column) 
If the matrix is located in a scroller, then the scroller will scroll so that the cell at position (row, column) of the matrix becomes visible.
Returns self.
#end_method

#begin_method
selected_column 
Returns the column of the currently selected cell. If no cell is selected the method returns 0.
#end_method

#begin_method
select_cell_at(row, column) 
Selects the cell at position (row, column). If row or column are non-valid the method will return nil.
Returns self.
#end_method

#begin_method
set_does_allow_empty_selection(boolean) 
Sets the does_allow_empty_selection property to boolean.
Returns self.
#end_method

#begin_method
set_double_click_action(message_name) 
Sets the double_click_action property to message_name.
Returns self.
#end_method

#begin_method
set_double_click_target(object) 
Sets the double_click_target property to object.
Returns self.
#end_method

#begin_method
set_mode(symbol) 
Sets the mode property to symbol.
The different modes are:
#track_mode - just track the mouse inside the cells
#highlight_mode - highlight the cell, then track, then unhighlight 
#radio_mode - Allow no more than one selected cell
#list_mode - Allow multiple selected cells
#end_method

Class Methods 

#begin_class_method
new 
Returns a new matrix object with no cells and no prototype.
Ex:
{matrix}:new
#end_class_method

#begin_class_method
new_with(prototype, rows, columns) 
Returns a new matrix object with prototype, rows and columns.
Ex:
{matrix}:new_with({button_cell}:new, 2, 2)
#end_class_method